
{extend name="index@common/base"/} 
{block name="style"}
{/block} {block name="body"}
<div class="layui-body layui-tab-content index-body" id="cont">
	<div class="park-navigation">
		<div class="navigation-icon">
			<i class="fa {$breadCrumb[0]['icon']}"></i>
		</div>
		<div class="navigation-menu">
			<h2>{$breadCrumb[0]['title']}</h2>
			{if isset($breadCrumb[1])}
			<p>{$breadCrumb[0]['remark']}</p>
			{/if}
		</div>
	</div>
	<div class="park-content">
		<div class="content-title">
			<div class="title col-9">
				<h3>{$breadCrumb[1]['title']}</h3>
				<form class="layui-form" action="{:url('rehearse/record/search')}" onsubmit="return false;">
					<button class="search-btn" lay-submit lay-filter="search"><img src="__STATIC__/img/base/topsearch01.png"></button>
					<input class="search-input" name="keyword" type="text" placeholder="事件名称" id="keyword"  autocomplete="off">
					<div class="date-duration">
						<div class="layui-input-inline">
							<input type="text" name="start" id="start" autocomplete="off" class="search-input" placeholder="开始时间">
						</div>
						<div class="layui-input-inline">
							<span>--</span>
						</div>
						<div class="layui-input-inline">
							<input type="text" name="end" id="end" autocomplete="off" class="search-input" placeholder="结束时间">
						</div>
					</div>
				</form>	
			</div>
			<div class="tool col-1">
				<button id="reload"><i class="fa fa-refresh"></i></button>
			</div>
		</div>
		<div class="layui-content" lay-accordion id="record" data-url="{:url('rehearse/record/index')}">
		</div>
	</div>
</div>
{/block}
{block name="script"}

<script type="text/javascript" src="__JS__/rehearse/record.js"></script>


<script id="tableTemplate" type="text/html">
	
        {{# for(var i = 0;i < d.length; i++){ }}
        <div class="maintab">
     	   <table class="record-table">
       	    	<thead>
					<tr>
                		<th>事件</th>
              			<th>救援时间</th>
						<th>参与救援单位</th>
						<th>总耗时</th>
						<th>指挥人或单位</th>
			 			<th ></th>
            		</tr>
				</thead>
			<colgroup>
                <col width="20%">
               	<col width="25%">
				<col width="10%">
				<col width="10%">
				<col width="10%">
				<col width="10%">
			</colgroup>
			<tbody>
  				<tr>
                	<th class="content">
						{{# if(d[i].filePath){ }}
							<a  href="__PUBLIC__{{d[i].filePath}}" style="color:#1e9fff">{{d[i].title}}</a>
						{{# }else{ }}
							{{d[i].title}} <span style="color: red">(未上传)</span>
						{{# } }}
					</th>
                	<th class="content"><p>{{d[i].execTime}}</p></th>
					<th class="content">{{d[i].attendUnit}}</th>
					<th class="content">{{d[i].timeConsuming}}</th>
					<th class="content">{{d[i].execStaffId}}</th>
					<th  style="text-align:center;">
						<a class="layui-btn btn-config add-recorddetail"  data-url="{:url('rehearse/record/recorddetailadd')}?recordId={{d[i].id}}&eventId={{d[i].eventId}}"><i class="fa fa-plus"></i></a>
						<a class="layui-btn btn-edit edit-record"  data-url="{:url('rehearse/record/edit')}?recordId={{d[i].id}}"><i class="fa fa-pencil"></i></a>
  						<a class="layui-btn btn-del del-record" data-url="{:url('rehearse/record/del')}?recordId={{d[i].id}}"><i class="fa fa-trash"></i></a>
					</th>
         		</tr>
			</tbody>
        </table>
        {{# if(d[i].records != null){ }}
            <div class="maintab">
                <table class="detail-table">
					<colgroup>
						<col width="5%">
						<col width="15%">
						<col width="35%">
						<col width="10%">
						<col width="10%">
					</colgroup>
					<tbody>
					{{# for(var j = 0;j < d[i].records.length; j++){ }}
					<tr>
						<td style="text-align:center">
							<p>{{d[i].records[j].stepIndex}}</p>
						</td>
						<td>
							<p><b>执行项目: </b>{{d[i].records[j].actionId}}</p>
						</td>
						<td>
							<p><b>行动内容: </b>{{d[i].records[j].stepDesc}}</p>
						</td>

						<td>
							{{# if (d[i].records[j].unit){}}
							{{# if (d[i].records[j].unit.chargePerson==0){}}
							<p><b>责任人: 安监端 </b></p>
							{{# } }}
							{{# if (d[i].records[j].unit.chargePerson!=0){}}
							<p><b>责任人: </b>{{d[i].records[j].unit.chargePerson}}</p>
							{{# } }}
							{{# } }}
							{{# if (d[i].records[j].unit==null) { }}
							<p><b>责任人:未填写</p>
							{{# } }}
						</td>
						<td>
							<p><b>执行状态: </b>

								{{# if(d[i].records[j].implementStatus==0){ }}未执行{{# } }}
								{{# if(d[i].records[j].implementStatus==1){ }}执行中{{# } }}
								{{# if(d[i].records[j].implementStatus==2){ }}已执行{{# } }}
							</p>
						</td>
						<td>

						</td>
						<td>
						</td>
						<td style="text-align:center;">
							<a class="layui-btn btn-edit edit-recorddetail" id="edit_{{d[i].records[j].id}}" data-url="{:url('record/recorddetailedit')}?recorddetailId={{d[i].records[j].id}}&eventId={{d[i].eventId}}&recordId={{d[i].id}}"><i class="fa fa-pencil"></i></a>
							<a class="layui-btn btn-del del-recorddetail"   id="del_{{d[i].records[j].id}}" data-url="{:url('record/recorddetaildel')}?recorddetailId={{d[i].records[j].id}}"><i class="fa fa-trash"></i></a>
						</td>
					</tr>
					{{# } }}
					</tbody>
				</table>

            </div>
          {{# } }}
		</div>
      {{# } }}
    </script>


{/block}

